/**
 * Copyright (C) 2011 - @le.nguyen
 * @Created Jun 22, 2011
 *
 * TODO
 */
package com.conan.app.dailyflickr.utils;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;

/**  */
public class FastDrawingBitmap extends Drawable{
	private Bitmap mBitmap;
	
	public FastDrawingBitmap(Bitmap b) {
		mBitmap = b;
	}

	/* (non-Javadoc)
	 * @see android.graphics.drawable.Drawable#draw(android.graphics.Canvas)
	 */
	@Override
	public void draw(Canvas canvas) {
		canvas.drawBitmap(mBitmap, 0.0f, 0.0f, null);
	}
	
	/* (non-Javadoc)
	 * @see android.graphics.drawable.Drawable#getOpacity()
	 */
	@Override
	public int getOpacity() {
		return PixelFormat.TRANSLUCENT;
	}

	/* (non-Javadoc)
	 * @see android.graphics.drawable.Drawable#setAlpha(int)
	 */
	@Override
	public void setAlpha(int alpha) {
	}

	/* (non-Javadoc)
	 * @see android.graphics.drawable.Drawable#setColorFilter(android.graphics.ColorFilter)
	 */
	@Override
	public void setColorFilter(ColorFilter cf) {
	}

	/* (non-Javadoc)
	 * @see android.graphics.drawable.Drawable#getIntrinsicWidth()
	 */
	@Override
	public int getIntrinsicWidth() {
		return mBitmap.getWidth();
	}

	/* (non-Javadoc)
	 * @see android.graphics.drawable.Drawable#getIntrinsicHeight()
	 */
	@Override
	public int getIntrinsicHeight() {
		return mBitmap.getHeight();
	}

	/* (non-Javadoc)
	 * @see android.graphics.drawable.Drawable#getMinimumWidth()
	 */
	@Override
	public int getMinimumWidth() {
		return mBitmap.getWidth();
	}

	/* (non-Javadoc)
	 * @see android.graphics.drawable.Drawable#getMinimumHeight()
	 */
	@Override
	public int getMinimumHeight() {
		return mBitmap.getHeight();
	}
	
	public Bitmap getBitmap(){
		return mBitmap;
	}
	
}
